#为数据集增加800个用户
from tqdm import tqdm
import random

path = 'F:\\LCW\\PycharmProject\\pytorch-learn\\RecSys\\dataset\\patent-100k-new\\patent-100k-new.txt'
pathItem = 'F:\\LCW\\PycharmProject\\pytorch-learn\\RecSys\\dataset\\patent-100k-new\\item2user.txt'

idcount = 1;
increaseCount = 0;

with open(pathItem,'r')as p:
    item_data = p.readlines();
    item_list = []
    for line in tqdm(item_data):
        item = line.split('\t')[0]
        count = line.split('\t')[1]
        if int(count) >= 92:
            item_list.append(item)
    print(item_list)


with open('increase.txt','a') as w:
    while idcount<=800:
        randomlist = random.sample(item_list,25)
        print(randomlist)
        for randomitem in randomlist:
            w.write(str(idcount) + '\t' + str(randomitem) + '\t' + '1' + '\n')
        idcount+=1;




